package com.example.deng.test;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

/**
 * Created by deng on 2017/4/6.
 */

public class in extends AppCompatActivity{
    private  DatabaseHandler1 dbHelper;
    private String number;
    private String timein;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_in);
        dbHelper=new DatabaseHandler1(this,"labcar",null,1);
        Button mbotton5 = (Button) findViewById(R.id.insurein);
        mbotton5.setOnClickListener(new Button.OnClickListener(){
            public void onClick(View v){
                EditText number1 = (EditText) findViewById(R.id.editText3);
                dbHelper.getWritableDatabase();
                time t1=new time();
                number=number1.getText().toString();
                timein=t1.channge(t1.getTime());
                car c1=new car(number,timein);
                dbHelper.adddata(c1,dbHelper);
                Intent intent = new Intent();
                intent.setClass(in.this,function.class);
                startActivity(intent);
            }
        });
    }
}
